{
  lib,
  buildLinux,
  fetchFromGitLab,
  ...
}@args:
buildLinux (
  args
  // rec {
    defconfig = "librem5_defconfig";
    version = "6.6.74-librem5";
    modDirVersion = version;
    src = fetchFromGitLab {
      domain = "source.puri.sm";
      owner = "Librem5";
      repo = "linux";
      rev = "pureos/6.6.74pureos1";
      hash = "sha256-qUPY+2fHVu7SFc+Uf8U7QtkQJJsE/4I1SavpLqJ/34c=";
    };
    kernelPatches = [ ];
    # see https://github.com/NixOS/nixpkgs/pull/366004
    ignoreConfigErrors = true;

    structuredExtraConfig = with lib.kernel; {
      # buildLinux overrides this and defaults to 32, so go back to the value defined librem5_defconfig
      # this is required for millipixels to take photos, otherwise the VIDIOC_REQ_BUFS ioctl returns ENOMEM
      CMA_SIZE_MBYTES = lib.mkForce (freeform "320");
    };
  }
  // args.argsOverride or { }
)
